package misc;

import enums.ExportOptionsEnum;
import enums.FileFilterEnum;
import enums.TextBundleEnum;
import enums.URLEnum;
import j_util.Utiles;

import java.io.File;
import java.util.Date;

/**
 * @author Jose Martin Rozanec;
 */
public class ExportDataPreferences {
    private ExportOptionsEnum sortBy;
    private ExportOptionsEnum sortAscendingDescending;
    private FileFilterEnum exportAs;
    private String directoryPath;
    private String institution;
    private String testName;

    private String path;

    public ExportOptionsEnum getSortBy() {
        return sortBy;
    }

    public void setSortBy(ExportOptionsEnum sortBy) {
        this.sortBy = sortBy;
    }

    public ExportOptionsEnum getSortAscendingDescending() {
        return sortAscendingDescending;
    }

    public void setSortAscendingDescending(ExportOptionsEnum sortAscendingDescending) {
        this.sortAscendingDescending = sortAscendingDescending;
    }

    public FileFilterEnum getExportAs() {
        return exportAs;
    }

    public void setExportAs(FileFilterEnum exportAs) {
        this.exportAs = exportAs;
    }

    public String getDirectoryPath() {
        return directoryPath;
    }

    public void setDirectoryPath(String directoryPath) {
        this.directoryPath = directoryPath;
    }

    public String getInstitution() {
        return institution;
    }

    public void setInstitution(String institution) {
        this.institution = institution;
    }

    public String getTestName() {
        return testName;
    }

    public void setTestName(String testName) {
        this.testName = testName;
    }

    public String getPath() {
        return path;
    }

    public void buildPath() {
        path = getDirectoryPath() + File.separatorChar +
                getInstitution() + File.separatorChar +
                BundlesProvider.getBundle(URLEnum.TEXT_BUNDLE).getString(
                        TextBundleEnum.TEST.toString()) + ((new Date()).toString()).replace(":", "");
        Utiles.createDirectory(path);
        path = path + File.separatorChar;
    }
}
